package returnDataStruct;

import Service.Implement.userServiceImplement;
import Service.userService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import pojo.message;

public class messageSingle {
    private Long message_id;
    private String user_name;
    private String content;

    public messageSingle() {
    }

    public messageSingle(message m) {
        this.message_id = m.getMessage_id();
        this.user_name = ((userService)  new ClassPathXmlApplicationContext("bean1.xml").getBean("userServiceImplement")).queryInformationByID(m.getUser_id()).getName();
        this.content = m.getContent();
    }

    public Long getMessage_id() {
        return message_id;
    }

    public void setMessage_id(Long message_id) {
        this.message_id = message_id;
    }

    public String getUser_name() {
        return user_name;
    }

    public void setUser_name(String user_name) {
        this.user_name = user_name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
